package com.google.shop.product.sms.utils;

import ch.qos.logback.classic.net.SyslogAppender;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Random;

/* loaded from: app.jar:BOOT-INF/classes/com/google/shop/product/sms/utils/RandomUtil.class */
public class RandomUtil {
    private static final Random random = new Random();
    private static final DecimalFormat fourdf = new DecimalFormat("0000");
    private static final DecimalFormat sixdf = new DecimalFormat("000000");

    public static String getFourBitRandom() {
        return fourdf.format((long) random.nextInt(10000));
    }

    public static String getSixBitRandom() {
        return sixdf.format((long) random.nextInt(1000000));
    }

    public static ArrayList getRandom(List list, int n) {
        Random random2 = new Random();
        HashMap<Object, Object> hashMap = new HashMap<>();
        for (int i = 0; i < list.size(); i++) {
            hashMap.put(Integer.valueOf(random2.nextInt(100) + 1), Integer.valueOf(i));
        }
        Object[] robjs = hashMap.values().toArray();
        ArrayList r = new ArrayList();
        for (int i2 = 0; i2 < n; i2++) {
            r.add(list.get(((Integer) robjs[i2]).intValue()));
            System.out.print(list.get(((Integer) robjs[i2]).intValue()) + SyslogAppender.DEFAULT_STACKTRACE_PATTERN);
        }
        System.out.print("\n");
        return r;
    }
}
